// 引入组件
import Home from '@/pages/Home';
import Login from '@/pages/Login';
import Register from '@/pages/Register';
import Search from '@/pages/Search';
import Detail from '@/pages/Detail';
import AddCartSuccess from '@/pages/AddCartSuccess';
import ShopCart from '@/pages/ShopCart';
import Trade from '@/pages/Trade';
import Pay from '@/pages/Pay';
import PaySuccess from '@/pages/PaySuccess';
import Center from '@/pages/Center';
//二级路由
import MyOrder from '@/pages/Center/MyOrder';
import GroupOrder from '@/pages/Center/GroupOrder';

export default [
    {
        name:'center',
        path:'/center',
        component:Center,
        meta:{show:true},
        children:[
           {
            path:'myorder',
            component:MyOrder
           },

           {
            path:'grouporder',
            component:GroupOrder
           },

           {
            path:'/center',
            redirect:'/center/myorder'  //重定向
           },
        ]
    },

    {
        name:'pay',
        path:'/pay',
        component:Pay,
        meta:{show:true}
    },

    {
        name:'paysuccess',
        path:'/paysuccess',
        component:PaySuccess,
        meta:{show:true}
    },

    {
        name:'tarde',
        path:'/trade',
        component:Trade,
        meta:{show:true}
    },

    {
       name:'shopcart',
       path:'/shopcart',
       component:ShopCart,
       meta:{show:true}
    },

    {
        path:'/home',
        component:Home,
        meta:{show:true}
    },
    {
        name:'login', 
        path:'/login',
        component:Login,
        meta:{show:false}  //在展示登录和注册路由页面时Footer不展示
    },
    {
        name:'register',
        path:'/register',
        component:Register,
        meta:{show:false}
    },
    {
        name:'search',
        path:'/search/:keyword?', //占位符         
        component:Search,
        meta:{show:true}
    },

    {
        name:'detail',
        path:'/detail/:goodsId?',
        component:Detail,
        meta:{show:true}
    },

    {
        name:'addcartsuccess',
        path:'/addcartsuccess',
        component:AddCartSuccess,
        meta:{show:true}
    },
    {//配置默认路由
        path:'/',
        redirect:'/home'
    }
]